Skip to content

Add scroll-based gear enchanting via Enchantress and apothecary bench#136

Merged
PJensen merged 7 commits intomasterfrom
copilot/add-gear-enchanting-system
Apr 29, 2026
Merged

Add scroll-based gear enchanting via Enchantress and apothecary bench#136
PJensen merged 7 commits intomasterfrom
copilot/add-gear-enchanting-system

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

This introduces an early-game enchanting path for gear progression using existing proc/affix infrastructure. Players can now acquire deterministic enchant scrolls from a dedicated Enchantress NPC or the apothecary bench, then apply them to weapons, armor, shields, rings, and amulets as persistent modifiers.

  • Enchanting workflow

    • Added a separate Enchantress NPC in the apothecary as the primary enchanting entry point
    • Kept the Enchanting Bench as a secondary station-based path
    • Crafting consumes thematic reagent roles plus gold and produces a deferred enchant scroll payload
    • Recipes now use canonical reagent item IDs and richer ingredient combinations, including existing ashes
  • Scroll-based persistent enchants

    • Added and normalized enchant scroll items for:
      • scroll_enchant_poison
      • scroll_enchant_fire
      • scroll_enchant_frost
      • scroll_enchant_flame_ward
      • scroll_enchant_venom_ward
      • scroll_enchant_fortified
    • Scrolls apply through the existing apply-item pipeline and bind persistent gear affixes:
      • poison → venomous1
      • fire → firestorm1
      • frost → frostbite1
      • flame ward → fireWard1
      • venom ward → poisonWard1
      • fortified → kineticWard1
    • Same-enchant reapplication is rejected without consuming the scroll; different enchants continue to stack
    • Offensive and defensive enchants now respect slot-compatible affix rules
  • Reagent economy and thematic drops

    • Added new reagent items such as spider legs, venom glands, binding resin, bone dust, ectoplasm, rune fragments, frost cores, beast claws, and cursed thread
    • Added themed reagent drop tables for beasts, spiders, undead, occult casters, witches, plants, dragons, and nymph/fey sources
    • Hooked plant/harvest interactions into reagent sourcing so resin and related materials can come from the world, not just shops
  • World + UI integration

    • Added dedicated Enchantress dialog/services and tied them into the existing dialog/runtime infrastructure
    • Expanded the enchanting overlay and wiring so it works for both the bench and NPC presentation
    • Kept the new bench in the apothecary and added the Enchantress as a separate town NPC/workpoint there
    • Updated economy/message wiring so crafting outcomes, missing requirements, and reagent pickups surface through the existing log flow
  • Inventory interaction polish

    • Apply-capable enchant scrolls now prefer the apply flow from inventory instead of generic use
    • Shared inventory helpers were tightened so apply-routing stays consistent between default action selection and action dispatch
  • Focused coverage

    • Added targeted tests for:
      • bench crafting dispatch
      • richer reagent/gold consumption and scroll output
      • successful weapon and accessory/ward enchant application
      • duplicate same-enchant rejection
      • dedicated Enchantress dialog registration
      • thematic reagent loot table coverage
      • inventory default-action behavior for enchant scrolls

Example of the new interaction shape:

dispatchRules({
  type: "rules.craftEnchant",
  payload: { benchId, recipe: "firestorm_script" },
});

// crafted scroll -> apply to gear
world.add(actor, ApplyIntent, {
  itemId: scrollId,
  targetItemId: weaponId,
});

[!WARNING]

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add enchanting system for gear with persistent modifiers Add scroll-based gear enchanting via apothecary bench Apr 29, 2026
Copilot AI requested a review from PJensen April 29, 2026 18:37
@PJensen
Copy link
Copy Markdown
Owner

PJensen commented Apr 29, 2026

@copilot you missed a huge portion of the original ask / memo. You branched out separate identifies apart from canonical itemIds, you failed to incorporate the creation of the thematic dropping of reagents from creatures and plants (resins) alike. You neglected the NPC completely. My suggestion was to start with a bench for simplicity, but also, to materially improve recipes, dropped reagents, utilize existing [Ash] and much more that makes the system really come alive.

This is your chance to create a full blown enchanting system and really make a name for yourself.

Smile

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 29, 2026

@copilot you missed a huge portion of the original ask / memo. You branched out separate identifies apart from canonical itemIds, you failed to incorporate the creation of the thematic dropping of rea...

Addressed in ad0ff1b. The apothecary now has a separate Enchantress NPC with her own dialog/services, enchanting recipes now come from canonical scroll/reagent data, themed reagents were added to creature and plant sources (including ashes/resin paths), and the expanded bindings now cover weapon and defensive/accessory gear. Screenshot: /tmp/enchantress-ui.png

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jsr.io
    • Triggering command: /home/REDACTED/.npm/_npx/05b6ef7b13673c57/node_modules/.bin/deno deno test --no-check --allow-read tests/enchantingBench.test.mjs tests/enchantingContent.test.mjs tests/rulesDispatchEnchanting.test.mjs tests/inventoryDefaultAction.test.mjs (dns block)
  • tombstone.jensen-petej.workers.dev
    • Triggering command: /tmp/pw-browsers/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell /tmp/pw-browsers/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl cal/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add scroll-based gear enchanting via apothecary bench Add scroll-based gear enchanting via Enchantress and apothecary bench Apr 29, 2026
Copy link
Copy Markdown
Owner

@PJensen PJensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's something

@PJensen PJensen marked this pull request as ready for review April 29, 2026 22:00
@PJensen PJensen merged commit 0ca32db into master Apr 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enchanting Early

2 participants